

#include <stdio.h>

#include "handle/handle.h"

int main ()
{
	char buf [20];
	handle h, j;
	userid id;

	kernel_init ();

	id = userid_request ();

	h = handle_request ("test", id);

	while (handle_trylock (h) != 0) printf ("spinning...\n");

	handle_write (h, "hello world", 12);

	handle_unlock (h);

	j = handle_duplicate (h, id, 6);

	handle_peak (h, buf, 12);
	printf ("%s\n", buf);

	handle_read (h, buf, 12);

	handle_release (h);

	handle_read (j, buf, 6);
	printf ("%s\n", buf);

	userid_release (id);

	block_release (block_request (10));
	block_release (block_request (100));
	block_release (block_request (1000));
	block_release (block_request (100));
	block_release (block_request (10));
	block_release (block_request (10));
	block_release (block_request (10));



}
